home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_qt.idb / usr / freeware / include / Qt / qtooltip.h.z / qtooltip.h
Encoding:
C/C++ Source or Header  |  1998-10-28  |  2.4 KB  |  95 lines

  1. /****************************************************************************
  2. ** $Id: qtooltip.h,v 2.19 1998/07/03 00:09:54 hanord Exp $
  3. **
  4. ** Definition of Tool Tips (or Balloon Help) for any widget or rectangle
  5. **
  6. ** Copyright (C) 1992-1998 Troll Tech AS.  All rights reserved.
  7. **
  8. ** This file is part of Qt Free Edition, version 1.40.
  9. **
  10. ** See the file LICENSE included in the distribution for the usage
  11. ** and distribution terms, or http://www.troll.no/free-license.html.
  12. **
  13. ** IMPORTANT NOTE: You may NOT copy this file or any part of it into
  14. ** your own programs or libraries.
  15. **
  16. ** Please see http://www.troll.no/pricing.html for information about 
  17. ** Qt Professional Edition, which is this same library but with a
  18. ** license which allows creation of commercial/proprietary software.
  19. **
  20. *****************************************************************************/
  21.  
  22. #ifndef QTOOLTIP_H
  23. #define QTOOLTIP_H
  24.  
  25. #ifndef QT_H
  26. #include "qwidget.h"
  27. #include "qtimer.h"
  28. #endif // QT_H
  29.  
  30.  
  31. class QTipManager;
  32. class QLabel;
  33.  
  34.  
  35. class QToolTipGroup: public QObject
  36. {
  37.     Q_OBJECT
  38. public:
  39.     QToolTipGroup( QObject *parent, const char *name = 0 );
  40.    ~QToolTipGroup();
  41.  
  42. signals:
  43.     void showTip( const char * );
  44.     void removeTip();
  45.  
  46. private:
  47.     friend class QTipManager;
  48. };
  49.  
  50.  
  51. class QToolTip
  52. {
  53. public:
  54.     QToolTip( QWidget *, QToolTipGroup * = 0 );
  55.  
  56.     static void add( QWidget *, const char * );
  57.     static void add( QWidget *, const char *,
  58.              QToolTipGroup *, const char * );
  59.     static void remove( QWidget * );
  60.  
  61.     static void add( QWidget *, const QRect &, const char * );
  62.     static void add( QWidget *, const QRect &, const char *,
  63.              QToolTipGroup *, const char * );
  64.     static void remove( QWidget *, const QRect & );
  65.  
  66.     static QFont    font();
  67.     static void        setFont( const QFont & );
  68.     static QPalette palette();
  69.     static void        setPalette( const QPalette & );
  70.  
  71. protected:
  72.     virtual void maybeTip( const QPoint & ) = 0;
  73.     void    tip( const QRect &, const char * );
  74.     void    tip( const QRect &, const char *, const char * );
  75.     void    clear();
  76.  
  77. public:
  78.     QWidget      *parentWidget() const { return p; }
  79.     QToolTipGroup *group()      const { return g; }
  80.  
  81. private:
  82.     QWidget        *p;
  83.     QToolTipGroup   *g;
  84.     static QFont    *ttFont;
  85.     static QPalette *ttPalette;
  86.  
  87.     static void initialize();
  88.     static void cleanup();
  89.  
  90.     friend class QTipManager;
  91. };
  92.  
  93.  
  94. #endif // QTOOLTIP_H
  95.